package follow.juc.writing.demo2;

/**
 * @Author tu zy
 * @Date 2020/12/7 13:41
 * @Version 1.0
 */
public class ThreadDemo9 {
    public static void main(String[] args) {
        Object object = new Object();
        Thread t = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    Thread.sleep(10000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
        t.start();
        while (true){
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(t.getState());
        }
    }
}
